Class D amplifier

ABSTRACT

The invention is directed to a class D amplifier. According to the class D amplifier, sound data applied to an input terminal is supplied through a compensation circuit to a PWM circuit, from which a PWM signal is output. The PWM signal is converted to an analog signal through a first low pass filter, which is delivered to a speaker. On the other hand, the sound data is delayed by a delay circuit, and is converted to an analog signal by a digital to analog converter. The higher frequency components of the data are removed by a second low pass filter, and the rest of the data is furnished to a differential amplifier. The differential amplifier amplifies a difference between an output of the first low pass filter and an output of the second low pass filter, which is then supplied to an analog to digital converter. The analog to digital converter converts an output from the differential amplifier to digital data, which is then supplied to the compensation circuit. By doing so, a compensation value based on an output from the analog to digital converter is added to the following PCM sound data that is applied to the input terminal.

PRIORITY CLAIM

This application is a divisional of U.S. patent application Ser. No.11/376,580, filed Mar. 15, 2006, which in turn claims priority fromJapanese Patent Application No. 2005-079062 filed on Mar. 18, 2005,Japanese Patent Application No. 2005-298562 filed on Oct. 13, 2005, andJapanese Patent Application No. 2006-054716 filed on Mar. 1, 2006, allof which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention relates to a class D amplifier that converts PCM (PulseCode Modulation) sound data to a PWM (Pulse Width Modulation) signal tobe amplified and output, and particularly to a class D amplifier that isdesigned to reduce output noise.

2. Description of Related Art

As is well known, in this type of D class amplifier, jitter within theclocks for a PWM conversion appears as output noise as it is. Anarithmetic error such as discarding lower bits in the digital process ata PWM conversion contributes to output noise. In a class D amplifier inprior art, as described in Japanese Patent Publication Sho 59-183510, anoutput of the class D amplifier is filtered through a low pass filter sothat it may be converted to an analog signal to be supplied to a load (aspeaker). At the same time, the analog signal is converted to a digitalsignal to be fedback to an input side. However, this type of processinghas a drawback that it requires a high precision A/D (analog to digital)converter, which increases the number of components and makes a circuitcomplex and expensive.

An amplifier has been in actual use that converts PCM sound data(“sound” here means general sound such as musical sound, without beinglimited to the so-called sound) to an analog signal, which in turn isconverted to a PWM signal. This amplifier, which performs analogprocessing, can easily feedback an output. But, there is a problem inthat when PWM is performed by an analog processing, it is susceptible toan extraneous signal and a signal such as input digital data.

An A/D converter is required in order to perform feedback by digitalprocessing, which raises a problem that the cost has gone up and at thesame time a complex feedback design has become difficult. Moreover,measuring power output by a count feedbacking it only deteriorates thequality of a feedback signal because of quantization noise caused at thetime when a pulse width is counted and noise induced by power.Accordingly, there is another problem that output quality has not beenimproved.

With regard to prior art literature for a class D amplifier, JapanesePatent Publication No. 2003-249825 is known.

In the situation, there is a need to solve the problems.

SUMMARY OF THE INVENTION

The invention is directed to a class D amplifier that satisfies thisneed. The class D amplifier has a simple structure and can effectivelyreduce distortion and noise over previous generations.

A first aspect of the invention relates to a class D amplifier thatcomprises a PWM circuit for receiving input data and converting theinput data to a PWM signal; a low pass filter (LPF) for passing onlywanted frequency components of the PWM signal; a digital to analogconverter for converting the input data to an analog signal; a filterfor only passing wanted frequency components of the analog signal fromthe digital to analog converter; a difference detector for detecting adifference between a signal output from the low pass filter and a signaloutput from the filter; a conversion unit for converting the detecteddifference to digital data; and a feedback unit for feedbacking theconverted digital data to an input of the PWM circuit.

Advantageously, the class D amplifier further comprises a load connectedto the low pass filter.

Advantageously, the conversion unit is an analog digital converter.

Advantageously, the conversion unit is a comparator.

Preferably, the class D amplifier further comprises a delay circuit fordelaying the input data by a predetermine amount of time to apply thedelayed input data to the digital to analog converter.

Preferably, the class D amplifier further comprises a dampingcompensation filter that is provided to the input of the PWM circuit fordamping a peak caused by a resonance of the amplifier.

Preferably, the class D amplifier further comprises a test signalgenerator for generating a test signal whose frequency successivelychanges to provide the test signal to the PWM circuit; an envelopemeasurement unit for measuring an envelope of the conversion unit; and acoefficient measurement unit for measuring a frequency response of asignal from the envelope measurement unit to thereby obtain coefficientsof the damping compensation filter.

Preferably, the class D amplifier further comprises an analog inputterminal for receiving an analog signal: a first switching unit forselectively supplying either the analog signal or the signal differenceto the conversion unit; and a second switching unit for selectivelysupplying either the input data or the converted digital data to the PWMcircuit.

Preferably, the filter is an anti-aliasing filter that functions as alow pass filter.

Preferably, the load is a speaker.

Preferably, the feedback unit includes one or more integrators.

A second aspect of the invention is directed to a class D amplifier thatcomprises a PWM circuit for receiving input data and converting theinput data to a PWM signal; a power amplifier for amplifying the PWMsignal; a low pass filter for passing low frequency components of theamplified PWM signal to a load; a digital to analog converter forconverting the input data to an analog signal; a first filter for onlypassing wanted frequency components of the analog signal from thedigital to analog converter; a second filter for only passing wantedfrequency components of the amplified PWM signal to a load; a differencedetector for detecting a difference between first filter output signaloutput from the first filter and second filter output signal from thesecond filter; a conversion unit for converting the detected signaldifference to digital data; and a feedback unit for feedbacking theconverted digital data to an input of the PWM circuit.

A third aspect of the invention relates to a class D amplifier thatcomprises a first PWM circuit for receiving input data and convertingthe input data to a first PWM signal; a power amplifier for amplifyingthe first PWM signal; a low pass filter for passing low frequencycomponents of the amplified first PWM signal to a load; a second PWMcircuit for converting the input data to a second PWM signal; a firstfilter for only passing wanted frequency components of the second PWMsignal; a second filter for only passing wanted frequency components ofthe amplified first PWM signal from the power amplifier; a differencedetector for detecting a difference between a first filter output signaloutput from the first filter and a second filter output signal outputfrom the second filter the second filter output; a conversion unit forconverting the detected signal difference to digital data; and afeedback unit for feedbacking the converted digital data to an input ofthe first PWM circuit.

Preferably, the conversion unit includes a dither generator forgenerating a dither signal; an adder for adding the dither signal to anoutput of the difference detector; a pulse width conversion unit forconverting an output of the adder to a pulse width; and a counter forconverting the pulse width to digital data.

A fourth aspect of the invention relates to a class D amplifier thatcomprises a PWM circuit for receiving input data and converting theinput data to a PWM signal; a power amplifier for amplifying the PWMsignal; a first low pass filter for passing low frequency components ofthe amplified PWM signal to a load; a level shifter for level-shiftingthe amplified PWM signal from the power amplifier to produce a pulsewidth; a counter for converting the pulse width from the level shifterto digital data; a second low pass filter for passing low frequencycomponents of the digital data from the counter; and a feedback unit forfeedbacking an output of the second low pass filter to an input of thePWM circuit.

Advantageously, a class D amplifier further comprises a compensationcircuit coupled to the PWM circuit for compensating quantization noisefrom the PWM circuit; and an adder provided in place of the feedbackunit for adding the output of the second low pass filter and the inputdata, by which an added result is applied to an input of the adder.

Advantageously, a class D amplifier further comprises a memory providedin place of the second low pass filter for storing the digital data fromthe counter into a memory address that corresponds to the input data ofthe PWM circuit, wherein the digital data in the memory is read outbased on the input data to be supplied to the adder.

Advantageously, a class D amplifier further comprises a compensationcircuit coupled to the PWM circuit for compensating quantization noisefrom the PWM circuit; an arithmetic unit provided in place of thefeedback unit for detecting a difference between the output of thesecond low pass filter and the input data, by which a detected result isadded to the quantization noise to be applied to the compensationcircuit.

Advantageously, a class D amplifier further comprises a memory providedin place of the second low pass filter for storing the digital data fromthe counter into a memory address that corresponds to the input data ofthe PWM circuit, wherein the digital data in the memory is read outbased on the input data to be supplied to the arithmetic unit.

Advantageously, when the digital data from the counter is stored in thememory, the storing is executed, after an average of data stored inaddresses which are found around an address used for previously storeddata is taken or after a low pass filter is applied.

A fifth aspect of the invention is directed to a class D amplifiercomprising:

a PWM circuit for receiving input data and converting the input data toa PWM signal; a power amplifier for amplifying the PWM signal; a lowpass filter for passing low frequency components of the amplified PWMsignal to produce a low-pass filtered signal to a load; a level shifterfor level-shifting the amplified PWM signal from the power amplifier toproduce a pulse width; a counter for converting the pulse width from thelevel shifter to digital data; a compensation circuit coupled to the PWMcircuit for compensating quantization noise from the PWM circuit; amemory for storing the digital data from the counter; a first adder foradding an output from the memory and the input data, by which an addedresult is applied to the compensation circuit; a digital to analogconverter for converting the input data to an analog signal; a filterfor only passing wanted frequency components of the analog signal fromthe digital to analog converter to produce a filtered analog signal; adifference detector for detecting for detecting a difference between thelow-pass filtered signal to the load and the filtered analog signal; aconversion unit for converting the detected signal difference to digitaldata; and a second adder the digital data from the conversion unit tothe compensation circuit, wherein the digital data from the counter isstored based on a memory address that corresponds to the input data tothe PWM circuit, and the stored data is read out based on the input datato the PWM circuit to be added to the first adder.

A sixth aspect of the invention is directed to a class D amplifier thatcomprises a PWM circuit for receiving input data and converting theinput data to a PWM signal; a low pass filter for passing low frequencycomponents of the PWM signal to a load to produce a low pass filteredsignal; a compensation circuit coupled to the PWM circuit forcompensating quantization noise from the PWM circuit; a digital toanalog converter for converting the input data to an analog signal; afilter for only passing wanted frequency components of the analog signalfrom the digital to analog converter to produce a filtered analogsignal; a difference detector for detecting a difference between the lowpass filtered signal to the load and the filtered analog signal from thefilter; a conversion unit for converting the detected signal differenceto digital data; and a digital filter for feedbacking the converteddigital data to an input of the compensation circuit.

Advantageously, the digital filter is an IIR filter.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram for illustrating a structure of a class Damplifier in accordance with a first embodiment of the invention.

FIG. 2 shows a waveform at each of selected portions of the class Damplifier in accordance with the first embodiment of the invention.

FIG. 3 is a block diagram for illustrating a structure of a class Damplifier in accordance with a second embodiment of the invention.

FIG. 4 are waveforms for illustrating damping components appearing in anoutput signal from a LPF.

FIG. 5 are waveforms for illustrating an operation of the class Damplifier shown in FIG. 3.

FIG. 6 is a block diagram for illustrating a structure of a coefficientmeasurement circuit, by which coefficients of a damping compensationfilter shown in FIG. 3 are obtained.

FIG. 7 are waveforms for illustrating an operation of the coefficientmeasurement circuit shown in FIG. 6.

FIG. 8 is a block diagram for illustrating a structure of a class Damplifier in accordance with a third embodiment of the invention.

FIG. 9 are waveforms for illustrating an operation of the class Damplifier shown in FIG. 8.

FIG. 10 is a block diagram for illustrating a structure of a class Damplifier in accordance with a fourth embodiment of the invention.

FIG. 11 is a block diagram for illustrating a structure of a class Damplifier in accordance with a fifth embodiment of the invention.

FIG. 12 is a set of waveforms for illustrating each function of a dithergenerator and an adder & comparator shown in FIG. 11.

FIG. 13 is a set of waveforms for illustrating an operation of theembodiment shown in FIG. 11.

FIG. 14 is a set of waveforms for illustrating an operation of theembodiment shown in FIG. 11.

FIG. 15 is a block diagram for illustrating a structure of a class Damplifier in accordance with a sixth embodiment of the invention.

FIG. 16A is a block diagram for illustrating a counter using a pulse ofthe embodiment shown in FIG. 15.

FIG. 16B is a block diagram for illustrating a counter using a sync ofthe embodiment shown in FIG. 15.

FIG. 17 is a set of waveforms for illustrating an operation of theembodiment shown in FIG. 15.

FIG. 18 is a block diagram for illustrating a structure of a class Damplifier in accordance with a seventh embodiment of the invention.

FIG. 19 is a block diagram for illustrating a structure of a class Damplifier in accordance with an eighth embodiment of the invention.

FIG. 20 is a block diagram for illustrating a structure of a class Damplifier in accordance with a ninth embodiment of the invention.

FIG. 21 is a set of waveforms for illustrating an operation of theembodiment shown in FIG. 20.

FIG. 22 is a block diagram for illustrating a structure of a class Damplifier in accordance with a tenth embodiment of the invention.

FIG. 23 is a block diagram for illustrating a structure of a class Damplifier in accordance with an eleventh embodiment of the invention.

FIG. 24 is a block diagram for illustrating a variation of the first tofifth embodiments of the invention.

DETAILED DESCRIPTION OF THE INVENTION

Referring to the figures, embodiments of the invention will be describedherein below.

FIG. 1 is a block diagram for illustrating a structure of a class Damplifier in accordance with a first embodiment of the invention. In thefigure, reference numeral 1 represents an input terminal for receivingPCM sound data that is obtained by digitalizing a sound signal (a“sound” here is not limited to a human voice sound itself, but meanssound in general, which also includes such as musical tone); referencenumeral 2, a compensation circuit; and reference numeral 3, a PWMcircuit that converts sound data from the compensation circuit 2 to aPWM signal. The compensation circuit 2, which performs DELTA SIGMAcompensation, compensates quantization noise of the PWM circuit 3. Forexample, when PCM sound data is 16 bits and resolution of the PWMcircuit 3 is 10 bits, quantization noise of 6 bits is produced. Thecompensation circuit 2 eliminates the 6-bit quantization noise byfeedbacking it to an input through an integrator to add it to the PCMsound data. In the embodiment, as shown in the figure, a third order IIRfilter is used as the compensation circuit 2. The third order IIR filterincludes an adder 2 j for adding the 6-bit quantization noise of the PWMcircuit 3 and an output from an analog to digital converter (called an“ADC” hereinbelow) 15; serially connected one-clock delay circuits 2 a,2 b and 2 c that receive an output from the adder 2 j; multipliers 2 d,2 e, and 2 f for multiplying each output of the delay circuits 2 a-2 cby a constant; and adders 2 g, 2 h, and 2 i for sequentially adding eachoutput of the multipliers 2 d-2 f to the PCM sound data.

The PWM circuit 3 contains a carrier signal generator therein forgenerating a sawtooth (or triangle) carrier signal. By comparing thecarrier signal with the sound data from the compensation circuit 2, thePWM circuit 3 produces and outputs a PWM signal. Reference numeral 4represents an output switching circuit consisting of serially connectedpower FETs (the FET stands for Field Effect Transistor) 4 a and 4 b;reference numeral 5, a low pass filter (LPF) that, comprising a coil anda capacitor, converts an output from the output switching circuit 4 toan analog sound signal; and reference numeral 6, a speaker (or a load)that receives an output from the LPF 5.

Reference numeral 11 denotes a delay circuit for delaying the PCM sounddata by a predetermined time; reference numeral 12, a digital to analogconverter (called a “DAC” hereinbelow) for converting an output from thedelay circuit 11 to an analog signal; and reference numeral 13, a lowpass filter. The LPF 13 has the same characteristics as those of the LPF5 when it is assumed to be ideal. Reference numeral 14 is a differentialamplifier for amplifying a difference between the output of the LPF 5and the output of the LPF 13, and reference numeral 15 is an ADC forconverting an output of the differential amplifier 14 to digital data.

FIG. 2 shows a waveform at selected portions of the class D amplifier inaccordance with the first embodiment of the invention. Referring to thewaveforms shown in FIG. 2, an operation of the above-mentioned class Damplifier will be described.

Sound data ((A) of FIG. 2) applied to the input terminal 1 is suppliedto the PWM circuit 3 via the compensation circuit 2, from which a PWMsignal ((B) of FIG. 2) is output. The PWM signal is converted to ananalog signal ((C) of FIG. 2) through the LPF 5, which is delivered tothe speaker 6.

On the other hand, the PCM sound data is delayed by the delay circuit 11((D) of FIG. 2), and is converted to an analog sound signal by the DAC12 ((E) of FIG. 2). The analog sound signal passes through the LPF 13with the higher components thereof removed ((F) of FIG. 2), and then issupplied to the differential amplifier 14. The reason why the delaycircuit 11 is used here is that a phase of the signal applied to thespeaker 6 can match that of the signal from the LPF 13, taking intoconsideration processing time by the compensation circuit 2 and the PWMcircuit 3 and delay time caused by the LPF 5 and the speaker 6.

The differential amplifier 14 amplifies a difference between the outputsignal from the LPF 5 and that from the LPF 13. Then the amplifieddifference is supplied to the ADC 15. The output from the differentialamplifier 14 corresponds to a waveform distortion caused by the LPF 5,the speaker 6, the compensation circuit 2, and the PWM circuit. The ADC15 converts the output signal from the differential amplifier 14 todigital data ((G) of FIG. 2), which is furnished to the compensationcircuit 2. This adds a compensated value based on the output from theADC 15 to subsequent PCM sound data that is to be applied to theterminal 1. In this way, the difference between the output signal fromthe LPF 13 and the output signal from the LPF 5, i.e., the signalapplied to the speaker 6, is controlled to be minimal.

As described above, according to the class D amplifier in FIG. 1, thesignal applied to the speaker 6 is not directly fedback to the input byconverting to digital data; instead, a difference between the LPF outputsignal and the speaker input signal is obtained, and the obtaineddifference signal is fedback to the input after being converted todigital data. Accordingly, the level of the fedback signal is quitesmall compared with that of the speaker input signal. This requires lessnumber of bits for the ADC 15. Instead of the ADC 15, a comparator (onebit ADC), which compares a constant level with a signal to detectwhether the signal is larger or smaller than the constant level, may beused.

The above-mentioned class D amplifier can be constructed at low cost,using the relatively low-cost DAC 12 and the ADC 15 having less numberof bits or a comparator. In addition, since a digital filter enables ahigh order filter easily, feedback characteristics can be designed atwill.

A second embodiment of the invention will be described next.

FIG. 3 is a block diagram for illustrating a structure of a class Damplifier in accordance with a second embodiment of the invention. Thedifference between the second embodiment and the first embodiment shownin FIG. 1 is that a damping compensation filter 18 is provided in frontof the compensation circuit 2 in the former.

FIG. 4 shows waveforms for illustrating a peak appearing in an outputsignal from the LPF.

In the first embodiment described above, since the LPF 5 connected tothe output switching circuit 4 is an LC circuit, the speaker 6 may havea resonance, which, as shown in (A) of FIG. 4, produces a peak in anoutput signal from the LPF 5, featured by a quality factor Q. On theother hand, an output signal from each of the DAC 12 and the LPF 13 canbe made to be smooth without ringing as characteristics. Therefore, thepeak featured by the quality factor Q appears in the output from thedifferential amplifier 14. It is possible to suppress a peak representedby the quality factor Q, using a feedback loop consisting of the ADC 15and the compensation circuit 2. In order to suppress such noise having ahigh voltage level by the use of the feedback loop, an open-loop gainshould be high.

Consequently, in the second embodiment, as described above, the dampingcompensation filter 18 is provided in front of the compensation circuit2 to curb the influence of the quality factor Q (refer to (B) of FIG.2).

The damping compensation filter 18 consists of an FIR filter or an IIRfilter. For example, with respect to coefficients of an FIR filter, afrequency response of “the LPF 5+the speaker 6” is obtained from theimpedances of the LPF 5 and the speaker 6 by the Fast Fourier Transform(FFT). The coefficients can be acquired from the obtained frequencyresponse.

FIG. 5 shows a waveform at each of selected portions for illustratingthe operation of the class D amplifier shown in the second embodiment.(A) of FIG. 5 represents the waveforms at each portion when no dampingcompensation filter 18 is provided; (B) of FIG. 5, the waveforms at eachportion when a damping compensation filter 18 is provided. (C) of FIG. 5shows the output of the PWM circuit 3; (D) of FIG. 5, the output of theLPF 5; (E) of FIG. 5, the output of the DAC 12; (F) of FIG. 5, theoutput of the LPF 13; and (G) of FIG. 5, the output of the ADC 15. As isclearly shown from the figure, the damping compensation filter 18 caneliminate the influence of the quality factor Q to allow an open-loopgain to be reduced.

FIG. 6 is a block diagram for illustrating a structure of a coefficientmeasurement circuit, by which coefficients of a damping compensationfilter shown in FIG. 3 are obtained.

FIG. 7 are waveforms at selected portions for illustrating an operationof the coefficient measurement circuit shown in FIG. 6.

When an impedance of the speaker 6 is unknown, as shown in FIG. 6, acoefficient measurement circuit 21 should be provided that contains atest signal generator 22, an envelope measurement circuit 23, and alevel measurement circuit 24. The test signal generator 22 delivers tothe input terminal 1 a sine wave (PCM data) whose frequency changescontinuously. When the sine wave is applied to the input terminal 1, asignal from each of the PWM circuit 3 and the DAC 12, as shown in (A) ofFIG. 7, becomes a sine wave whose frequency varies successively. Asignal from the LPF 5, as shown in (B) of FIG. 7, has a peak at aresonant frequency. As a result of (C) of this, a signal from thedifferential amplifier, as shown in (B) of Figure, has a peak in itswaveform, which is converted to digital data by the ADC 15 to besupplied to the envelope measurement circuit 23.

The envelope measurement circuit 23 integrates an output of the ADC 15to obtain an envelope thereof, which is furnished to the levelmeasurement circuit 24. The level measurement circuit 24 measures anlevel, for example, a voltage level of the envelope and performs theoperation of the Fast Fourier Transform (FFT). Using the result of theFFT operation, filter coefficients of the damping compensation filter 18can be acquired.

The coefficient measurement circuit 21 may be provided in a factory forproducing a class D amplifier, and at the time of shipping the class Damplifier, the filter coefficients of the damping compensation filter 18may be set. It is also acceptable to have filter coefficients built in aclass D amplifier, so that an automatic measurement and setting of thefilter coefficients can be performed. By doing so, regarding the class Damplifier, a user himself can set the filter coefficients, for example,when he changes the speakers 6.

A third embodiment of the invention will be described.

FIG. 8 is a block diagram for illustrating a structure of a class Damplifier in accordance with a third embodiment of the invention. Thethird embodiment is different from the first embodiment in the followingpoints. Firstly, the third embodiment includes an analog switch 31.Secondly, the third embodiment includes switches 32-34. That is, a firstcontact of the switch 32 is connected to the input terminal 1; a secondcontact, the output terminal of the ADC 15; and a common contact, aninput of an input terminal of the compensation circuit 2.

A first contact of the switch 33 is connected to the compensationcircuit 2, while a second contact is connected to the output terminal ofthe ADC 15. A common contact of the switch 34 is connected to the inputof the ADC 15; a first contact, the output terminal of the differentialamplifier 14; and a second contact, the analog input terminal 31.

Using the arrangement described above as an amplifier for amplifying PCMsound data, the first contact of the switch 32 is connected to thecommon contact thereof, the switch 33 is turned on, and the firstcontact of the switch 34 is connected to the common contact thereof.When the switches are connected as mentioned above, respectively, thecircuit of FIG. 8 becomes identical to that of FIG. 1.

When the D class amplifier is used for amplifying an analog soundsignal, the second contact of the switch 32 is connected to the commoncontact thereof, the switch 33 is off, and the second contact of theswitch 34 is connected to the common contact thereof. With the switchesconnected in this way, when an analog sound signal is applied to theanalog input terminal 31, it is furnished to the ADC 15 via the switch34 to be converted to digital music data by the ADC 15. Then, thedigital music data is furnished to the PWM circuit 3 through the switch32 and the compensation circuit 2. The PWM circuit 3 converts the musicdata to a PWM signal, which is applied to the speaker 6 via the outputswitching circuit 4 and the LPF 5. In the arrangement, the differentialamplifier 14 cannot be used to constitute a feedback loop, but insteadcan be used to compensate quantization noise by the compensation circuit2.

FIG. 9 shows waveforms at each section when a digital signal isconverted to an analog signal at time t1.

A fourth embodiment in accordance with the invention will be explained.

FIG. 10 is a block diagram for illustrating a structure of a class Damplifier in accordance with a fourth embodiment of the invention. Thedifference between the fourth embodiment in FIG. 10 and the firstembodiment in FIG. 1 is that in the former, an output from the switchingcircuit 4 is applied to the differential amplifier 14 via a low passfilter (LPF) 41 that has the same characteristics as those of the LPF 5,while in the latter an output from the LPF 5 is furnished to thedifferential amplifier 14. The fourth embodiment cannot suppress thedistortion of the LPF 5, but can suppress the distortion of theswitching circuit 4. Since load variation need not be taken intoconsideration, there is an advantage that loop design becomes easier.

When the LPF 13 and the LPF 41 have the identical characteristics, theydo not have to be identical to those of the LPF 5. The LPF 13 and theLPF 41 may be the same circuit to input a difference.

A fifth embodiment of the invention will be described.

FIG. 11 is a block diagram for illustrating a structure of a class Damplifier in accordance with a fifth embodiment of the invention. Thedifferences between the fifth embodiment and the fourth embodiment areas follows. First, in the former, a multiplier 43 is provided formultiplying the sound data at the input terminal 1 by −1 before thedelay circuit 11. Second, a PWM circuit 44 is provided in place of theDAC 12. Third, a dither generator 45 is newly provided. Fourth, an adderand comparator 46 is provided that consists of an adder for adding anoutput from the LPF 41, an output from the dither generator 45, and froman output from the LPF 13, and a comparator for converting the addedresults to a pulse width. Fifth, a counter 47 and a multiplier 48 areprovided, in which the counter 47 count the clock pulse from the PWMcircuit 3 when the output from the adder and comparator 46 is “H (high)”and the multiplier 48 multiplies an output form the counter 47 by −1.

FIG. 12 is a set of waveforms for illustrating each function of a dithergenerator and an adder & comparator shown in FIG. 11. Since an outputfrom the PWM circuit 44 corresponds to an inverted signal of an outputof the switching circuit 4, an error can be extracted between the outputfrom the PWM circuit 44 and the output from the switching circuit 4, byadding each output from the LPF 41 and the LPF 13. The error, shown by asymbol L1 in FIG. 12, may be a DC component voltage or a non-invertedvoltage, which may not activate the comparator in the adder andcomparator 46. In this case, the counter 47 does not work, so that itdoes not produce an output representing the error. Applying a signaldenoted by symbol L2 such as a triangular dither by the dither generator45 to the adder and comparator 46 makes the comparator work. Thisproduces from the adder and comparator 46 a PWM signal represented by L3to which the error is converted. Synchronizing a triangular dither withthe PWM period and counting the signal based on the PWM period by thecounter 47 can make the error digital data that is synchronized with thePWM period.

With respect to the embodiment, replacing the DAC 12 in FIG. 10 by thePWM circuit 44 and the ADC 15 by the counter 47 can reduce the cost.When input data of the PWM circuit 44 is multiplied by −1 and an outputfrom the counter 47 is multiplied by −1, the differential amplifier 14in FIG. 10 can be replaced by the adder and comparator 46. After adither (a triangle wave or random noise) is added to each output of theLPF 41 and the LPF 13, whose added results are converted to a pulsewidth, resolution will be improved when the counter 47 counts based onthe PWM period. Accordingly, no ADC 14 is required. Moreover, in placeof multiplying the input data of the PWM circuit 44 by −1, an outputfrom the PWM circuit 44 may be inverted.

FIG. 13 is a set of waveforms for illustrating an operation of theembodiment shown in FIG. 11. In the embodiment mentioned above,referring to FIG. 13, a case will be described where time a timeconstant (a cutoff frequency) of the LPF 13 and the LPF 41 is set at avalue (approximately ten times to one tenth) close to the PWM frequencyof the PWM circuit 3.

In FIG. 13, symbols S1 and S2 denote an output of the switching circuit4 and the PWM circuit 44, respectively. Symbols Z1 and Z2 represent eachoutput of the LPF 41 and the LPF 13, respectively. Symbols H1 and H2show envelopes of the solid lines Z1 and Z2, respectively. As shown inFIG. 13, the envelopes H1 and H2 are canceled, and the residues (solidlines Z1 and Z2) of the PWM wave are compared mutually. There is noerror in a stable state, in which a signal having a duty of 50% can beobtained as a result of adding each output of the LPF 41 and the LPF 13.Electric power variation and offset is detected as an error in the addedresults of each output of the LPF 41 and the LPF 13.

FIG. 14 is a set of waveforms for illustrating an operation of theembodiment shown in FIG. 11. The added results of each output of the LPF41 and the LPF 13 in a stable state are shown by the long-dashed line L2a in the figure. When an offset is produced, the added results areshifted to be shown by the dot-dashed line L2 b. When a gain varies, aPWM signal is varied to be represented by the short-dashed line L2 c,whose apexes are changed. In the situation, when the long-dashed line L2a and the short dashed line L2 c are added, a trapezoidal signal shownby the solid line L2 d is created. Converting the trapezoidal signal toa PWM signal by a comparator generates a signal shown by the solid lineL3 b. Since a PWM signal when there is no error (symbol L2 a) isrepresented by the dashed line L3 a, an error is indicated as adifference in pulse width of the signals L3 a and L3 b. The error may beextracted by counting the difference based on the PWM clock through thecounter 47. This improves resolution substantially. As a consequence,since the resolution that is equivalent to the output PWM is obtainedwithout adding dither, the noise shaper (compensation circuit 2) cansuppress noise.

FIG. 24 is a block diagram for illustrating a variation of the first tofifth embodiments of the invention. In the first to fifth embodimentdescribed above, in order to feedback the output of the ADC 15 to theinput of the PWM circuit 3, the compensation circuit 2 shown in FIG. 1is used, to which the output of the ADC 15 is applied. However, to havea feedback characteristic that is different from the compensationcircuit 2, as shown in FIG. 24, the output of the ADC 15 should beconnected to a digital filter 200 that is different from thecompensation circuit 2, and the output of the digital filter 200 shouldbe added to the adder 2 g of the compensation circuit 2. The digitalfilter 200 is an IIR filter, consisting of delay circuits 201-203 fordelaying by one clock, adders 204-207, and multipliers 208-212.

As is clear from FIG. 24, the PWM circuit 3 is directly connected to thecompensation circuit 2, which produces no delay. However, there isplenty of delay between the PWM circuit 3 and the output of the ADC 15because there are the switching circuit 4, the low pass filter 5, thedifferential amplifier 14, and the ADC 15 therebetween. Because of this,phase compensation is required between the output of the ADC 15 and theinput of the compensation circuit 2. Since a configuration shown in FIG.24 includes the digital filter 200 apart from the compensation circuit2, independent feedback characteristic can be freely designed, whichenables more efficient and stable characteristics.

A sixth embodiment of the invention will be discussed below.

FIG. 15 is a block diagram for illustrating a structure of a class Damplifier in accordance with a sixth embodiment of the invention. In thefigure, reference numeral 51 denotes an input terminal for PCM sounddata; reference numeral 52, a multiplier for multiply the PCM sound databy a constant coefficient A; reference numeral 53, an adder; andreference numeral 54, a PWM circuit. The PWM circuit 54, which isconstructed similar to the PWM circuit 3 in FIG. 1, converts the sounddata from the adder 53 to a PWM signal based on the clock pulse CLK.Reference numeral 55 designates a switching circuit consisting ofserially connected power transistors Trs 55 a and 55 b; referencenumeral 56, a low pass filter (LPF), consisting of a LC circuit of coilsand capacitors, to transform an output from the switching circuit 55 toanalog sound signal; and reference numeral 57, a speaker (a load) thatreceives an output from the LPF 56.

Reference numeral 58 represents a level shifter for shifting a voltagelevel of an output form the switching circuit 55 by resistance division,so that the level shifted voltage can be applied to an input of adigital LSI. Generally, the amplitude of the level shifted voltage mayrange 5V-3.3V-1.6V. Reference numeral 59 is a counter for carrying outupcount of the clock pulse CLK when an output of the level shifter 58 is“H (high).” This regenerates an output value of the PWM. Added to thecounted value is an error derived from an output from the PWM circuit 54affected by the switching circuit 55.

FIG. 16A is a block diagram for illustrating a counter 59 using a pulseof the embodiment shown in FIG. 15. A DIFF 59 a of FIG. 16A generates apulse signal in response to a rising edge of the output from the levelshifter 58. A counter 59 b is reset in response to the rising edge ofthe pulse signal, and carries out upcount of the clock pulse when theoutput of the level shifter 58 is “H.” On a rising edge of the nextpulse, a counter value of the counter 59 b is read into a latch 59 c,which measures a PWM width.

FIG. 16B is a block diagram for illustrating a counter 59 using a syncof the embodiment shown in FIG. 15. The sync, which is a frame headersignal of the PWM, is used to reset a counter 59 d, which performsupcount of the clock pulse CLK when the output of the level shifter 58is “H” and downcount of the clock pulse CLK when the output of the levelshifter 58 is “L (low).” A counter value of the counter 59 d is readinto a latch 59 e on the following sync.

Since the counter in the figure is synchronized with the sync of thePWM, the output data does not depend on a PWM waveform, but on the sync.

Reference numeral 60 of FIG. 15 represents a digital low pass filterthat has the same characteristics as those of the LPF 56. Referencenumeral 60 is a multiplier for multiplying the output from the LPF 60 bya coefficient k, whose output is added to the adder 53.

In the configuration, PCM sound data applied at the input terminal 51 isconverted to a PWM signal by the PWM circuit 54, which is thenvoltage-amplified by the switching circuit 55 having the powertransistors Trs 55 a and 55 b. The voltage-amplified signal passes theLPF 56 consisting of coils and capacitors to have a carrier component ofthe PWM eliminated. Then, the signal is supplied to a load 57 such as aspeaker. This produces a large capacity of output.

Since a gap is provided so that delay in the power transistors Trs 55 aand 55 b may not vary or the power transistors Trs 55 a and 55 b may notbe simultaneously turned on, a signal is produced that has a timingdifferent from that of the PWM output, which causes distortion in theload output.

Accordingly, in the embodiment, the output of the power transistors Trs55 a and 55 b is level shifted by a resistance division, which iscounted by the clock pulse CLK to regenerate a PWM output value.

The value is derived by adding an error (e) created by a variation ofthe power transistors to a PWM input value. Because the signal passesthe digital low pass filter 60 having the same characteristics as thoseof the LPF 56, a digital signal is obtained that is at the same level asthe load output. The signal from the LPF 60 is multiplied by a feedbackcoefficient k to be added to the input signal at the adder 53. This isexpressed by the following equation.y={x(1−k)}/{1−kLPF(z)}+e/{1−kLPF(z)} where a coefficient A of themultiplier 52 is (1−k) and the value k is negative. Since the gain ofthe low pass filter is 0 dB within a passband, the output y is equal tox within the passband and the error e is suppressed by (1−k). This meansthat quantization noise by PWM is also suppressed simultaneously.

FIG. 17 is a set of waveforms for illustrating an operation of theembodiment shown in FIG. 15. As shown in (A) of FIG. 17, when sound dataD0, D1, and D3 are successively input from the input terminal 51, theyare converted to a PWM signal by the PWM circuit 54 ((B) of FIG. 17).The signal is then voltage-amplified by the power transistors Trs 55 aand 55 b ((D) of FIG. 17), and then has the carrier component thereofeliminated by the LPF 56 ((C) of FIG. 17).

The power transistors Trs 55 a and 55 b supply their output behind thePWM output and with an error caused by dead time, rising time, andfalling time. The output is level-shifted to a logic voltage by thelevel shifter 58 to be applied to the counter 59. The counter 59 countstime from a rising edge to a falling edge, of the output from the powertransistors Trs 55 a and 55 b to measure pulse width ((E) of FIG. 17)and produce an output ((F) of FIG. 17). An upcounter may be used formeasuring pulse width. When the measured results are supplied to the lowpass filter 60 after measuring the pulse width, a digital signal can beobtained that is the same as an output from the low pass filter 56 ((G)of FIG. 17). The digital signal is multiplied by the feedback gain k,and is provided to the input, which can eliminate distortion and noise.

FIG. 18 is a block diagram for illustrating a structure of a class Damplifier in accordance with a seventh embodiment of the invention. Likereference numerals are assigned to the structural elements in FIG. 18that are identical to those of the embodiment in FIG. 15, and noexplanation of the elements is repetitiously given. The seventhembodiment of FIG. 18 is different from the embodiment of FIG. 15 in thefollowing point. In FIG. 18, the multiplier 52 of FIG. 15 is deleted,and a compensation circuit 63 is added.

The compensation circuit 63 is a circuit for performing a DELTA SIGMAcompensation and compensating quantization noise of the PWM circuit 54.Moreover, the compensation circuit 63 feedbacks the quantization noiseto the input through integration circuits. The quantization noise isadded to the PCM sound data to be removed. As shown in the figure, thecompensation circuit 63 is a third order IIR filter that consists ofdelay circuits 63 a, 63 b, and 63 c serially connected for delaying byone clock, multipliers 63 d, 63 e, and 63 f for multiplying an outputfrom the delay circuits 63 a, 63 b, and 63 c by a constant,respectively, and adders 63 g, 63 h, and 63 i for successively adding anoutput from the multipliers 63 d, 63 e, and 63 f to the PCM sound data,respectively.

Since there are many cases where the digital low pass filter 60 of theembodiment in FIG. 15 has two or more order, it is difficult to raisethe loop gain k. Accordingly, sufficient suppression cannot be obtained.Therefore, quantization noise, which is a dominant error, should besuppressed by a noise shaper (a compensation circuit 63). This givesrise to an advantage that each noise measured at the counter 59 and thedigital low pass filter 60 is related to the power transistors Trs 55 aand 55 b and small in amount to lead to a low loop gain.

FIG. 19 is a block diagram for illustrating a structure of a class Damplifier in accordance with an eighth embodiment of the invention. Likereference numerals are assigned to the structural elements in FIG. 19that are identical to those of the embodiment in FIG. 18, and noexplanation of the elements is repetitiously given. The eighthembodiment of FIG. 19 is different from the embodiment of FIG. 18 in thefollowing points. The eighth embodiment is newly provided with anarithmetic circuit 65 for obtaining an error between the output from themultiplier 61 and the sound data from the input terminal 51, amultiplier 66 for multiplying the output from the arithmetic circuit 65by a constant coefficient, and an adder 67 for adding the quantizationnoise from the PWM circuit 54 and the output from the multiplier 66,whose addition result is supplied to the delay circuit 63 c in thecompensation circuit 63.

The arithmetic circuit 65 obtains an error between the digital PCM sounddata from the input terminal 51 and the signal regenerated by thedigital low pass filter 60. The error signal is applied to the noiseshaper (the compensation circuit 63) to be suppressed. In the case, thedesign of third or more order filters can be made easier to increase asuppression gain, by which a system having few distortion noise can beconstructed.

With regard to the embodiment of FIG. 19, the design of the low passfilter 60 is difficult to make, the output is produced by a PWM cycledelay because of the measurement at the counter, and delay exists onaccount of a large amount of process. This gives rise to a problem thatit is difficult to construct an effective noise shaper.

FIG. 20 is a block diagram for illustrating a structure of a class Damplifier in accordance with a ninth embodiment of the invention thathas solved the problem. Like reference numerals are assigned to thestructural elements in FIG. 20 that are identical to those of theembodiment in FIG. 19, and no explanation of the elements isrepetitiously given. The ninth embodiment of FIG. 20 is different fromthe eighth embodiment of FIG. 19 in the following points. The ninthembodiment is newly provided with an memory 71 in place of the low passfilter 60 and the multiplier 61 of the eighth embodiment of FIG. 19, anaddress generator 72 for generating addresses of the memory 71 based onthe data input to the PWM circuit 54, a multiplier 73 for multiplyingoutput data of the memory 7 i by a constant coefficient, and an adder 74for adding the output from the multiplier 73 and the output from thecounter 59, whose added results are applied to the input terminal of thememory 71.

According to the embodiment, a value derived by counting a pulse width(an output from the counter circuit 59) is stored in a memory addressthat corresponds to the input data to the PWM circuit 54, and is used asa compensation table. The arithmetic circuit 65 compares the output datafrom the memory 71 with the PCM sound data from the input terminal 51,whose comparison results are fed to the noise shaper (the compensationcircuit 63). Since this constitutes a loop in disregard of a PWM cycledelay caused by the counter circuit 59, effective noise elimination canbe realized. However, because the output from the counter 59 is a pulsein power stage, it is liable to receive noise and is not stable. Whenreading the data into the memory 71, an average value of the data andthe previous data should be taken, or as shown in FIG. 20, a low passfilter should be constructed for the previous data, by which noise canbe eliminated. The multiplier is provided for that purpose.

Moreover, in a case where an output is taken from the memory 71, takingan average of the output values is more effective, by using an addressbefore and behind a desired address.

FIG. 21 is a set of waveforms for illustrating an operation of theembodiment shown in FIG. 20. The waveforms also show the timing of theoperation. In the figure, the operation by the counter 59 including themeasurement ((A) to (E) of FIG. 21) is the same as that explainedregarding FIG. 17 ((A) to (E) of FIG. 17). The output of the counter 59is written into the memory 71 based on the output from the addressgenerator 72, i.e., based on the address data corresponding to the inputdata for the PWM circuit 54. At this time, because the previous andfollowing memory address needs to be read to obtain a low pass filterand feedback data, using the present data and previous data of thememory 71, the corresponding data is read in making the address −1, +1,+0 in the first half of a period. In the situation, a PWM signal of dataD0 is output and E0 is obtained ((F) of FIG. 21) at the counter 59.

Addresses D2−1 to D2+1 are generated ((G) of FIG. 21), using the data(PCM musical data) from the input terminal 51, in order to eliminatenoise around the memory 71 in the first half of the PWM period. Sincethe corresponding data F2−/F2/F2+ is output ((I) of FIG. 21), noise canbe eliminated taking an average of the data. The data is added to inputdata D2 as data FB2 ((K) of FIG. 21) and is input to the PWM circuit 54as data D2′ ((B) of FIG. 21). When a pulse width is measured by thecounter 59 behind a PWM cycle and E0 is obtained ((F) of FIG. 21), readin is executed first and the previous data E0 is read out, in accordancewith an address D0′. The previous data E0 and the presently read outdata E0 are arithmetically operated, and the result of the operation iswritten in the memory 71 as data F0 new ((J) of FIG. 21).

FIG. 22 is a block diagram for illustrating a structure of a class Damplifier in accordance with a tenth embodiment of the invention. In thefigure, reference numeral 81 designates a memory and noise eliminatorthat is identical to the memory 71, the multiplier 73, and the adder 74.The output of the memory and noise eliminator 81 is applied to themultiplier 82 that adjusts a gain. The output of the multiplier 82 isadded to the adder 63 g of the compensation circuit 63. The adder 65,the multiplier 66, and adder 67 in FIG. 20 are not provided. Otherconfiguration of FIG. 22 is the same as that of FIG. 20. In theembodiment, a memory output is fedback to an input to remove noise,which is the same function as that of the embodiment of FIG. 20.

The memory and noise eliminator 81 in the embodiment may be constructedby an average circuit, not a low pass filter as in FIG. 20.

According to the ninth and tenth embodiments, a signal derived bydividing the power output using a resistance division through the levelshifter 58 can be averaged with respect to time, averaged based on aprevious and subsequent level such as a voltage level, or processedusing a low pass filter. This eliminates influence caused by surroundingnoise or quantization, which enables precise feedback.

In the ninth and tenth embodiments, an error signal between the outputfrom the counter 59, which is not furnished to the memory, and thedigital signal from the input terminal 51 may be calculated and stored.In the case, the output from the memory can be directly applied to thenoise shaper (compensation circuit).

In the sixth to eighth embodiments, phase compensation may be added tothe low pass filter 60 when the need arises. The DC component of thecounter 59 is detected through the low pass filter whose cutofffrequency is set at a low value to shut down the output from the PWMcircuit 54 or the output from the switching circuit 55, so that the load57 may be protected. The counter 59 and the low pass filter 60 areprovided, but the output from the level shifter may be directly appliedto the low pass filter 60.

FIG. 23 is a block diagram for illustrating a structure of a class Damplifier in accordance with an eleventh embodiment of the invention.The eleventh embodiment is derived by adding the noise eliminationconfiguration (reference numerals 11-15) shown in the fourth embodimentFIG. 10 to the tenth embodiment of FIG. 22. In the eleventh embodiment,an adder 85 is incorporated between delay circuits 63 b and 63 c so asto attach the ADC 15 to the compensation circuit 63.

It is a matter of course that the present invention can be applied tonot only sound data but also other kinds of data such as musical data.

The invention is mainly used for a digital AV amplifier.

The invention provides a class D amplifier that enables a simplestructure and effectively reduces distortion and noise over previousgenerations. In addition, with regard to a difference conversion, analogto digital conversion can be used to convert an analog signal to a PWMsignal.

Since the invention handles as digital a signal derived bylevel-shifting power output through a resistance division, the circuitcan be constructed at low cost. Moreover, the invention uses a digitalsignal processor (DSP) without using an analog filter, quantizationnoise and environmental noise can be eliminated, and a signal that isequivalent to one derived by AD conversion is obtained to acquire highlyprecise feedback.

While preferred embodiments of the invention have been described andillustrated above, it should be understood that these are exemplary ofthe invention and are not to be considered as limiting. Additions,omissions, substitutions, and other modifications can be made withoutdeparting from the spirit or scope of the present invention.Accordingly, the invention is not to be considered as being limited bythe foregoing description, and is only limited by the scope of theappended claims.

1. A class D amplifier comprising: a first PWM circuit for receivinginput data and converting the input data to a first PWM signal; a poweramplifier for amplifying the first PWM signal; a low pass filter forpassing low frequency components of the amplified first PWM signal to aload; a second PWM circuit for converting the input data to a second PWMsignal; a first filter for only passing wanted frequency components ofthe second PWM signal; a second filter for only passing wanted frequencycomponents of the amplified first PWM signal from the power amplifier; adifference detector for detecting a difference between a first filteroutput signal output from the first filter and a second filter outputsignal output from the second filter; a conversion unit for convertingthe detected signal difference to digital data; and a feedback unit forfeedbacking the converted digital data to an input of the first PWMcircuit.
 2. A class D amplifier as recited in claim 1, wherein theconversion unit includes: a dither generator for generating a dithersignal; an adder for adding the dither signal to an output of thedifference detector; a pulse width conversion unit for converting anoutput of the adder to a pulse width; and a counter for converting thepulse width to digital data.
 3. The class D amplifier as recited inclaim 1, wherein the feedback unit comprises an adder for adding thequantization noise of the first PWM circuit and an output of theconversion unit.
 4. The class D amplifier as recited in claim 3, whereinthe conversion unit comprises: a counter for counting a clock pulse fromthe first PWM circuit; and a multiplier for multiplying an output fromthe counter by −1.